from flask import Flask
from flask import request
from flask import render_template
from baidu_yiqing import Spider_yiqi
from flask_cors import CORS
import json

app = Flask(__name__)
CORS(app, supports_credentials=True)

@app.route('/chinadata')
def chinadata():
    with open('yiqing_china.json',encoding='utf8') as f:
        j=f.read()
    return j

@app.route('/trend')
def trend():
    with open('trend.json',encoding='utf8') as f:
        j=f.read()
    return j

@app.route('/globalList')
def globalList():
    with open('globalList.json', encoding='utf8') as f:
        j = f.read()
    return j

@app.route('/newAddTopProvince')
def newAddTopProvince():
    with open('newAddTopProvince.json', encoding='utf8') as f:
        j = f.read()
    return j

@app.route('/summaryDataIn')
def summaryDataIn():
    with open('summaryDataIn.json', encoding='utf8') as f:
        j = f.read()
    return j

@app.route('/topOverseasInput')
def topOverseasInput():
    with open('topOverseasInput.json', encoding='utf8') as f:
        j = f.read()
    return j

@app.route('/homehotsearch')
def home_hot_search():
    with open('home_hot_search.json', encoding='utf8') as f:
        j = f.read()
    return j


if __name__ == '__main__':
    spider=Spider_yiqi()
    app.run()